//
//  NoNetWorkingView.m
//  lsOA
//
//  Created by 蓝水软件 on 16/8/12.
//  Copyright © 2016年 苏州蓝水有限公司. All rights reserved.
//

#import "NoNetWorkingView.h"

@implementation NoNetWorkingView


- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    _noNetWordView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KSWidth, 35)];
    _noNetWordView.backgroundColor = [UIColor colorWithRed:1.000 green:0.937 blue:0.346 alpha:1.000];
    _noNetWordView.hidden = NO;
    [self addSubview:_noNetWordView];
    _noNetWordTitle = [[UILabel alloc]init];
    _noNetWordTitle.text = @"网络不给力,请检查网络设置!";
    _noNetWordTitle.font = [UIFont systemFontOfSize:16];
    [_noNetWordView addSubview:_noNetWordTitle];
    _noNetWordTitle.hidden = NO;
    [_noNetWordTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_noNetWordView);
        make.left.mas_offset(50);
        make.right.mas_offset(-30);
    }];
    _warningImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"警告"]];
    [_noNetWordView addSubview:_warningImage];
    _warningImage.hidden = NO;
    [_warningImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(5);
        make.centerY.equalTo(_noNetWordView);
        make.size.mas_equalTo(CGSizeMake(25, 25));
    }];
    return self;
}

- (void)setHidden:(BOOL)hidden{
    _noNetWordView.hidden = hidden;
    _noNetWordTitle.hidden = hidden;
    _warningImage.hidden = hidden;
}


@end
